package com.sunbim.rsrv.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 管理风险
 * </p>
 *
 * @author yuhui
 * @since 2021-12-30
 */
@Getter
@Setter
@ToString
@TableName("risk_manage")
@ApiModel(value = "RiskManage对象", description = "管理风险")
public class RiskManage implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("所属用户id")
    @JsonProperty("user_id")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty("所属文物id")
    @JsonProperty("relics_id")
    @TableField("relics_id")
    private Integer relicsId;

    @ApiModelProperty("火灾隐患")
    @TableField("fire")
    @NotNull(message = "火灾隐患风险分数不能为空")
    private Integer fire = 0;

    @ApiModelProperty("消防措施")
    @TableField("firefighting")
    @NotNull(message = "消防措施风险分数不能为空")
    private Integer firefighting = 0;

    @ApiModelProperty("防雷")
    @TableField("thunder")
    @NotNull(message = "防雷风险分数不能为空")
    private Integer thunder = 0;

    @ApiModelProperty("安防")
    @TableField("defense")
    @NotNull(message = "安防风险分数不能为空")
    private Integer defense = 0;

    @ApiModelProperty("游客承载量")
    @TableField("visitor")
    @NotNull(message = "游客承载量风险分数不能为空")
    private Integer visitor = 0;

    @ApiModelProperty("总分")
    @TableField("score")
    private Integer score = 0;

    @ApiModelProperty("风险等级")
    @JsonProperty("level")
    @TableField(exist = false)
    private Integer level = 0;

    @ApiModelProperty("主要问题")
    @TableField("problem")
    private String problem;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonProperty(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonProperty(value = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


}
